using System;

namespace UtilsExtensionsAndHelpers.Helpers
{
    public interface IFileHelper
    {
        /// <summary>
        /// Get or set the action that provides feedback. 
        /// A message (string) will be passed in.
        /// IE. Log(message), Console.WriteLine(message)
        /// </summary>
        Action<String> FeedbackProvider { get; set; }

        /// <summary>
        /// Creates the needed parent directories if they don't exist.
        /// </summary>
        /// <param name="fileName">Name to the file you want the parent directory path created for.</param>
        void EnsureParentDirExists(string fileName);

        /// <summary>
        /// Reads through a file line by line till it hits an ending marker, then passes what it's found to the action.
        /// After passing a string to the action, it clears and starts again. Very handy for xml lists. Just set the ending
        /// tag as the endingMarker.
        /// </summary>
        /// <param name="filePath">Full path to the file being read.</param>
        /// <param name="beingLinesToSkip">If you need to skip any lines, like DTD</param>
        /// <param name="endingMarker">A string marking the end of a section</param>
        /// <param name="action">What you want to do with the string</param>
        void ReadThroghFile(string filePath, string endingMarker, Action<string> action);

        /// <summary>
        /// Reads through a file line by line till it hits an ending marker, then passes what it's found to the action.
        /// After passing a string to the action, it clears and starts again. Very handy for xml lists. Just set the ending
        /// tag as the endingMarker.
        /// </summary>
        /// <param name="filePath">Full path to the file being read.</param>
        /// <param name="beingLinesToSkip">If you need to skip any lines, like DTD</param>
        /// <param name="endingMarker">A string marking the end of a section</param>
        /// <param name="action">What you want to do with the string</param>
        void ReadThroghFile(string filePath, int beingLinesToSkip, string endingMarker, Action<string> action);

        /// <summary>
        /// Reads through a file line by line till it hits an ending marker, then passes what it's found to the action.
        /// After passing a string to the action, it clears and starts again. Very handy for xml lists. Just set the ending
        /// tag as the endingMarker.
        /// </summary>
        /// <param name="filePath">Full path to the file being read.</param>
        /// <param name="beingLinesToSkip">If you need to skip any lines, like DTD</param>
        /// <param name="endingMarker">A string marking the end of a section</param>
        /// <param name="action">What you want to do with the string</param>
        /// <param name="feedbackProvider">A method to handle messages</param>
        void ReadThroghFile(string filePath, int beingLinesToSkip, string endingMarker, Action<string> action, Action<string> feedbackProvider);

        /// <summary>
        /// Reads through a file line by line, passing each line to the action.
        /// Very handy for CSV for any other text files. 
        /// </summary>
        /// <param name="filePath">Full path to the file being read.</param>
        /// <param name="action">What you want to do with the string</param>
        void ReadThroghFileByLine(string filePath, Action<string> action);

        /// <summary>
        /// Reads through a file line by line, passing each line to the action.
        /// Very handy for CSV for any other text files. 
        /// </summary>
        /// <param name="filePath">Full path to the file being read.</param>
        /// <param name="beingLinesToSkip">If you need to skip any lines, like CSV hearers</param>
        /// <param name="action">What you want to do with the string</param>
        void ReadThroghFileByLine(string filePath, int beingLinesToSkip, Action<string> action);

        /// <summary>
        /// Reads through a file line by line, passing each line to the action.
        /// Very handy for CSV for any other text files. 
        /// </summary>
        /// <param name="filePath">Full path to the file being read.</param>
        /// <param name="beingLinesToSkip">If you need to skip any lines, like CSV hearers</param>
        /// <param name="action">What you want to do with the string</param>
        /// <param name="feedbackProvider">A method to handle messages</param>
        void ReadThroghFileByLine(string filePath, int beingLinesToSkip, Action<string> action, Action<string> feedbackProvider);
    }
}